package com.wbihua.grpc.demo.controller;

import com.wbihua.grpc.demo.entity.User;
import com.wbihua.grpc.demo.mapper.UserMapper;
import com.wbihua.grpc.demo.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/hello")
public class HelloController {

    @Autowired(required = false)
    private HelloService helloService;

    @GetMapping(value = "/{name}")
    public String hello(@PathVariable("name") String name){
        return helloService.echo(name);
    }
}
